package GUI;

import java.awt.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: tao
 * Date: 2023-11-27
 * Time: 15:53
 */
class FirstFrame extends Frame {
    String name;
    public FirstFrame(String name) {
        super(name);
        this.name = name;
    }

}
public class Test1 {
    public static void main(String[] args) {
        Frame frame = new Frame(("FlowLayout"));
        frame.setBounds(100, 100, 400, 200);
        frame.setLayout(new FlowLayout());

        Button button1 = new Button("button1");
        Button button2 = new Button("button2");
        Button button3 = new Button("button3");
        Button button4 = new Button("button4");
        Button button5 = new Button("button5");

        button1.setBackground(Color.BLUE);
        button2.setBackground(Color.YELLOW);
        button3.setBackground(Color.RED);
        button4.setBackground(Color.GREEN);
        button5.setBackground(Color.pink);

        frame.add(button1);
        frame.add(button2);
        frame.add(button3);
        frame.add(button4);
        frame.add(button5);

        frame.setVisible(true);
    }
}
